package org.tankwar.model;

import org.tankwar.util.GlobalUtil;
import org.tankwar.util.ImageUtil;
import org.tankwar.view.GamePanel;

import java.awt.*;

public class River extends StaticGameComponent{
    public River(int x, int y, GamePanel tc) { // River的构造方法
        // 设置河流的宽和高
        this.width = 55;
        this.height = 154;
        // 读取图片
        componentImage = GlobalUtil.tk.getImage(this.getClass().getResource(ImageUtil.RIVER_IMAGE_URL));
        this.x = x;
        this.y = y;
        this.gamePanel = tc; // 获得控制
    }
    @Override
    public void draw(Graphics g) {
        g.drawImage(componentImage, x, y, null); // 在对应X，Y出画河
    }
}
